<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <style>
    /* flex-grow 比如box1 box3 设置为1 box2为2 那就把空间设置为4等分进行乘积分配大小 */
    /* flex-basis 占多少百分比 */
    .container {
      display: flex;
      height: 50px;
    }
    .container div {
      flex-basis: 10%;
    }
    .box1 {
      height: 100%;
      background-color: red;
      flex-shrink: 3;
    }
    .box2 {
      height: 100%;
      background-color: blue;
      flex-shrink: 3;
    }
    .box3 {
      height: 100%;
      background-color: red;
      flex-shrink: 3;
    }
  </style>
  <body>
    <div class="container">
      <div class="box1"></div>
      <div class="box2"></div>
      <div class="box3"></div>
    </div>
  </body>
</html>
